home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Palettes / ScrollViewDeluxe / ScrollViewDeluxe.h < prev    next >
Text File  |  1993-11-01  |  5KB  |  183 lines

  1. // Format: 80 columns, tabs = 4 spaces
  2. #import <appkit/appkit.h>
  3.  
  4. @interface ScrollViewDeluxe : ScrollView
  5. {
  6.     id        topView;            // View at top that scrolls horiz with docView
  7.     BOOL    topViewVisible;        // Wheter to show topView
  8.     ClipView *topClip;            // The ClipView associated with topView
  9.  
  10.     id        leftView;            // View at left that scrolls vert with docView
  11.     BOOL    leftViewVisible;    // Whether to show leftView
  12.     ClipView *leftClip;            // The ClipView associated with leftView
  13.  
  14.     Class    rulerClass;            // The class to use for default top/left view
  15.     NXSize    rulerSize;            // The size to use for default top/left view
  16.  
  17.     id        syncViews;            // List of views to be sync'ed with docView
  18.     id        horizSyncViews;        // List of views to be sync'ed horizontally
  19.     id        vertSyncViews;        // List of views to be sync'ed vertically
  20.         
  21.     id        horizScrollerViews; // List of views in the horizontal scroller
  22.     id        vertScrollerViews;    // List of views in the vertical scroller
  23.  
  24.     Matrix    *pageUpDownButtons;            // Matrix with page up/down buttons
  25.     BOOL    pageUpDownButtonsVisible;    // Whether to show page up/down buttons
  26.  
  27.     Matrix    *pageLeftRightButtons;        // Matrix with page left/right buttons
  28.     BOOL    pageLeftRightButtonsVisible;// Whether to show page left/rt buttons
  29.     
  30.     Matrix    *zoomButton;                // Button with zoom popUp.
  31.     BOOL    zoomButtonVisible;            // Whether to show zoom popUp
  32.     
  33.     Panel    *zoomPanel;                    // Panel for arbitrary scale
  34.     TextField *zoomText;                // Text field in zoomPanel
  35. }
  36.  
  37. // Query and set the topView
  38. - topView;
  39. - setTopView:view;
  40.  
  41. // Query and set whether topView is visible
  42. - (BOOL)topViewVisible;
  43. - setTopViewVisible:(BOOL)flag;
  44.  
  45. // Convenience methods for setting topView visible inside of IB
  46. - showTopView:sender;
  47. - hideTopView:sender;
  48. - toggleTopView:sender;
  49.  
  50. // Query and set the leftView
  51. - leftView;
  52. - setLeftView:view;
  53.  
  54. // Query and set whether leftView is visible
  55. - (BOOL)leftViewVisible;
  56. - setLeftViewVisible:(BOOL)flag;
  57.  
  58. // Convenience methods for setting leftView visible inside of IB
  59. - showLeftView:sender;
  60. - hideLeftView:sender;
  61. - toggleLeftView:sender;
  62.  
  63. // Convenience methods for showing/hiding/toggling top/left views as a pair
  64. - showRulers:sender;
  65. - hideRulers:sender;
  66. - toggleRulers:sender;
  67.  
  68. // Query and set the default top/left view class
  69. - (Class)rulerClass;
  70. - setRulerClass:(Class)class;
  71.  
  72. // Query and set the default top/left view size
  73. - (NXSize)rulerSize;
  74. - setRulerSize:(NXSize)size;
  75.  
  76. // Query, add and remove views that are sync'ed horizontally with docView
  77. - syncViews;
  78. - addSyncView:view at:(int)at;
  79. - removeSyncView:view;
  80. - removeSyncViewAt:(int)at;
  81.  
  82. // Query, add and remove views that are sync'ed horizontally with docView
  83. - horizSyncViews;
  84. - addHorizSyncView:view at:(int)at;
  85. - removeHorizSyncView:view;
  86. - removeHorizSyncViewAt:(int)at;
  87.  
  88. // Query, add and remove views that are sync'ed vertically with docView
  89. - vertSyncViews;
  90. - addVertSyncView:view at:(int)at;
  91. - removeVertSyncView:view;
  92. - removeVertSyncViewAt:(int)at;
  93.  
  94. // Query, add and remove views in the horizontal scroller
  95. - horizScrollerViews;
  96. - addHorizScrollerView:view at:(int)at;
  97. - removeHorizScrollerView:view;
  98. - removeHorizScrollerViewAt:(int)at;
  99.  
  100. // Query, add and remove views in the vertical scroller
  101. - vertScrollerViews;
  102. - addVertScrollerView:view at:(int)at;
  103. - removeVertScrollerView:view;
  104. - removeVertScrollerViewAt:(int)at;
  105.  
  106. // Return the matrix with the page up/down & left/right buttons or zoom button
  107. - pageUpDownButtons;
  108. - pageLeftRightButtons;
  109. - zoomButton;
  110.  
  111. // Query and set whether page up/down buttons are visible or needed
  112. - (BOOL)pageUpDownButtonsVisible;
  113. - setPageUpDownButtonsVisible:(BOOL)flag;
  114. - (BOOL)needPageUpDownButtons;
  115.  
  116. // Query and set whether page left/right buttons are visible or needed
  117. - (BOOL)pageLeftRightButtonsVisible;
  118. - setPageLeftRightButtonsVisible:(BOOL)flag;
  119. - (BOOL)needPageLeftRightButtons;
  120.  
  121. // This is the target for the page buttons. Does page scroll based on tag
  122. - pageButton:sender;
  123.  
  124. // Query and set whether zoom buttons are visible
  125. - (BOOL)zoomButtonVisible;
  126. - setZoomButtonVisible:(BOOL)flag;
  127.  
  128. // This is the target for zoomButton's popUpList. Calls zoomTo::.
  129. - zoom:sender;
  130.  
  131. // This method tries to call zoomTo:: on support views. Failing that, it scales
  132. - (BOOL)zoomTo:(float)zoomX :(float)zoomY;
  133.  
  134. // This method stops the zoom panels modal session
  135. - stopZoomPanel:sender;
  136.  
  137. // This method is implemented to do scrolling for rulers and dependent views
  138. - scrollClip:(ClipView *)clipView to:(const NXPoint *)newBoundsOrigin;
  139.  
  140. // Used by scrollClip:to: to synchronize all dependent clipViews (ruler, etc)
  141. - synchronizeClipView:newClip withClipView:oldClip
  142.     horizontally:(BOOL)horizSync vertically:(BOOL)vertSync;
  143.  
  144. // Overridden to account for multiple clipviews in a scroll view
  145. - reflectScroll:view;
  146.  
  147. // Overridden to do extra work of tiling rulers & scroller views
  148. - tile;
  149. - tileScrollerViews;
  150.  
  151. // Archiving
  152. - write:(NXTypedStream *)stream;
  153. - read:(NXTypedStream *)stream;
  154.  
  155. @end
  156.  
  157. @interface RulerClass : Object
  158. - setHorizontal;
  159. - setVertical;
  160. @end
  161.  
  162. @interface View(Convenience)
  163. - (NXCoord)frameX;
  164. - (NXCoord)frameY;
  165. - (NXPoint)frameOrigin; 
  166. - (NXCoord)frameWidth;
  167. - (NXCoord)frameHeight;
  168. - (NXSize)frameSize;
  169. - (NXRect)frame;
  170.  
  171. - (NXCoord)boundsX;
  172. - (NXCoord)boundsY;
  173. - (NXPoint)boundsOrigin;
  174. - (NXCoord)boundsWidth;
  175. - (NXCoord)boundsHeight;
  176. - (NXSize)boundsSize;
  177. - (NXRect)bounds;
  178. @end
  179.  
  180. @interface Scroller(PerCent)
  181. - (float)perCent;
  182. @end
  183.